From: Alex Crichton Date: Wed, 29 Nov 2017 01:44:25 +0000 (-0800) Subject: Fix the lockfile-compat test X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~4^2~41^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=a0dfbb7a967f465ed034334a0cd2bd2e4cb60511;p=cargo.git Fix the lockfile-compat test The newest version of `tar` tweaks the checksum here slightly as the tarball is slightly different, so this just updates the test to pull the checksum from the publication rather than hardcoding it. --- diff --git a/tests/lockfile-compat.rs b/tests/lockfile-compat.rs index 0c90fd417..c8a16aa2e 100644 --- a/tests/lockfile-compat.rs +++ b/tests/lockfile-compat.rs @@ -79,9 +79,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" #[test] fn frozen_flag_preserves_old_lockfile() { - Package::new("foo", "0.1.0").publish(); + let cksum = Package::new("foo", "0.1.0").publish(); - let old_lockfile = + let old_lockfile = format!( r#"[root] name = "zzz" version = "0.0.1" @@ -95,8 +95,10 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum foo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f9e0a16bdf5c05435698fa27192d89e331b22a26a972c34984f560662544453b" -"#; +"checksum foo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "{}" +"#, + cksum, + ); let p = project("bar") .file("Cargo.toml", r#" @@ -109,7 +111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" foo = "0.1.0" "#) .file("src/lib.rs", "") - .file("Cargo.lock", old_lockfile) + .file("Cargo.lock", &old_lockfile) .build(); assert_that(p.cargo("build").arg("--locked"),